﻿@model Nop.Web.Models.Catalog.ProductEmailAFriendModel
@using Nop.Web.Framework.UI.Captcha;
@{
    Layout = "~/Views/Shared/_Root.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.ProductEmailAFriend").Text);
}
<div class="emailafriend-page">
    <div class="page-title">
        <a href="@Url.RouteUrl("Product", new { productId = Model.ProductId, SeName = Model.ProductSeName })" class="product">@Model.ProductName</a>
    </div>
    @if (Model.SuccessfullySent)
    {
        @Model.Result
    }
    else
    {
        <div class="send-email">
            @using (Html.BeginForm())
            {
                <div class="message-error">
                    @Html.ValidationSummary(true)
                </div>
                <div>
                    @Html.LabelFor(model => model.FriendEmail)
                    @Html.TextBoxFor(model => model.FriendEmail, new { @class = "friendemail" })
                    @Html.ValidationMessageFor(model => model.FriendEmail)
                </div>
                <div>
                    @Html.LabelFor(model => model.YourEmailAddress)
                    @Html.TextBoxFor(model => model.YourEmailAddress, new { @class = "youremail" })
                    @Html.ValidationMessageFor(model => model.YourEmailAddress)
                </div>
                <div>
                    @Html.LabelFor(model => model.PersonalMessage)
                    @Html.TextAreaFor(model => model.PersonalMessage, new { @class = "personalmessage" })
                    @Html.ValidationMessageFor(model => model.PersonalMessage)
                </div>
                if (Model.DisplayCaptcha)
                {
                    <div>
                        @Html.Raw(Html.GenerateCaptcha())
                    </div>
                }
                <input type="submit" id="send-email" name="send-email" value="@T("Products.EmailAFriend.Button")" />
            }
        </div>
    }
</div>
